<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新品有戏后台管理</title>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <style>
        tr td{
            text-align: center;
            vertical-align: middle!important;
        }
    </style>
</head>
<body>
{include file="base/header" /}
<table class="layui-table">
    <thead>
    <tr>
        <td>商品名称</td>
        <td>单价(元)</td>
        <td>申请单号</td>
        <td>应结算数(个)</td>
        <td>状态</td>
    </tr>
    </thead>
    <tbody>
    {foreach $result as $val}
    <tr>
        <td>{$val.pname}</td>
        <td>{$val.purchaseprice}</td>
        <td>{$val.ordernumber}</td>
        <td>{$val.anumber}</td>
        {if $val.status == 1}
            <td style="color:red;" id="status">未结算</td>
        {else/}
            <td style="color:#333333;">已结算</td>
        {/if}
    </tr>
    {/foreach}
    </tbody>
</table>
</body>
<script>
    function settlement(id) {
        $.ajax({
            url:"{:url('index/apply/settlement')}",
            data:"id="+id,
            type:"post",
            dataType:"json",
            success:function (res) {
                if(res.success){
                    layer.alert(res.success,{bnt:['确定','取消']},function () {
                        //刷新页面
                        window.location.reload();
                    },function () {
                        //刷新页面
                        window.location.reload();
                    });
                }
                if(res.error){
                    layer.alert(res.error);
                }
            }
        });
    }
</script>
</html>